package cn.doitedu.smart_marketing.rule;

import cn.doitedu.datagen.LogBean;
import cn.doitedu.smart_marketing.beans.ClickhouseQueryRes;
import cn.doitedu.smart_marketing.beans.RuleMatchResult;
import cn.doitedu.smart_marketing.querytools.ClickhouseQuerier;

import java.io.Serializable;
import java.util.Random;

/***
 * @author hunter.d
 * @qq 657270652
 * @wx haitao-duan
 * @date 2021/7/22
 **/
public class TestRule implements Serializable {
    Random random = new Random();
    ClickhouseQuerier ckQuerier;
    public TestRule(ClickhouseQuerier ckQuerier){
        this.ckQuerier = ckQuerier;
    }


    public RuleMatchResult matchRule(LogBean logBean){
        RuleMatchResult ruleMatchResult = new RuleMatchResult();
        ruleMatchResult.setRuleId("test_rule");
        ruleMatchResult.setMatchEvent(logBean.getEventId());
        ruleMatchResult.setMatchEventTimeStamp(logBean.getTimeStamp());
        ruleMatchResult.setMatchProcessTimeStamp(System.currentTimeMillis());

        // B{p1=v1} 发生过3次




        return random.nextInt(10)%3==0?ruleMatchResult:null;
    }
}
